﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;
using HsTec.Mobile.Green.SqlServerDAL;
using Baimasoft.FrameWork.Base;
using Baimasoft.Manage.SqlServerDAL;

public partial class DocumentManage_Document_Add_Bottom : System.Web.UI.Page
{
    BaimasoftFile MyFile = new BaimasoftFile();
    LogManage MyLog = new LogManage();
    DataFolder MyDF = new DataFolder();


    protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            try
            {
                AspNetHelper.BtnGrantInfo(this);  //按钮控制
            }
            catch
            {
            }
        }
    }
    /// <summary>
    /// 文档删除
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void BtnCut_Click(object sender, EventArgs e)
    {
        try
        {
            int iHid = Convert.ToInt32(HID.Value.ToString().Trim());
            string m_Root = ConfigurationManager.AppSettings["DocumentMange"];  //取Web.Config文件中的配置信息
            string str = m_Root + HPath.Value.ToString().Trim();              //写到服务器上的路径

            MyFile.DeleteDirectory(str);  //删除文件夹

            MyDF.DeleteDataFolderInfo(iHid);
            //日志
            try
            {
                string sPerID = (string)Session["Baimasoft_Pers_ID"];
                string sContent = "用户" + (string)Session["Baimasoft_User_LogonID"] + "删除文件夹：" + str;
                string sIP = Page.Request.UserHostAddress;
                MyLog.InsertLog("3", sPerID, sContent, sIP);
            }
            catch
            {
                string sContent = "删除文件夹：" + str;
                string sIP = Page.Request.UserHostAddress;
                MyLog.InsertLog("3", "0", sContent, sIP);
            }

        }
        catch
        {
        }
    }
}
